﻿<UserControl x:Class="LiveTiss.Guias.GuiaSP_SADT"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    mc:Ignorable="d"
    xmlns:guia="clr-namespace:LiveTiss.Guias"
    xmlns:uc="clr-namespace:LiveTiss.Guias.UserControls"
    xmlns:converter="clr-namespace:LiveTiss.Classes.TypeConverter" Width="910" x:Name="guia">
    
    <UserControl.Resources>
        <converter:ByteToImageConverter x:Key="byteToImageConverter" />
        <converter:EnumConverter x:Key="enumConverter" />
    </UserControl.Resources>
    
    <StackPanel Width="910">
        <Grid Height="125" Margin="0,0,0,0" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="90.5"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Rectangle x:Name="PlaceHolder_Logo" Fill="#FFF4F4F5" Margin="0" Stroke="Black" Width="80" Height="80" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            <Image Name="imgLogoPrestadora" Margin="1,0,0,0" Width="78" Height="78" HorizontalAlignment="Center" VerticalAlignment="Center"
                Source="{Binding Path=Guia.identificacaoGuiaSADTSP.LogoPrestadora, ElementName=guia, Converter={StaticResource byteToImageConverter}, Mode=OneWay}"/>
            <TextBlock x:Name="Tipo_de_Guia" TextWrapping="Wrap" Text="Guia de Serviço Profissional / Serviço Auxiliar de Diagnóstico e Terapia - SP/SADT" VerticalAlignment="Top" Grid.Column="1" Margin="6,4,10,0" Height="72" FontSize="24" d:LayoutOverrides="VerticalAlignment"/>
            <TextBlock x:Name="Numero" TextWrapping="Wrap" Text="nº:" Grid.Column="1" Margin="7,75,9,0" FontSize="16" Height="27" VerticalAlignment="Top"/>
            <TextBox Name="txtNumeroGuia" Height="25" Margin="67,76,0,21" Width="415" Grid.Column="1" HorizontalAlignment="Left" IsReadOnly="True" MaxLength="20" 
                Text="{Binding Path=Guia.identificacaoGuiaSADTSP.numeroGuiaPrestador, ElementName=guia, Mode=OneWay}"/>
        </Grid>
        <Grid Margin="0,19,0,0" VerticalAlignment="Top">
            <Rectangle RadiusY="6" RadiusX="6" Stroke="#4D898989"/>
            <StackPanel Margin="12,4,8,0">
                <Grid Width="890" Margin="0,0,6,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Margin="0" Grid.ColumnSpan="2" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" FontFamily="Segoe UI" FontSize="13.333" Text="Registro ANS / CNPJ:"/>
                        <ComboBox Name="cbxIdentificacaoFontePagadora" Width="180" Margin="0,6,0,0" HorizontalAlignment="Left" SelectedValue="Key" DisplayMemberPath="Value"
                            ItemsSource="{Binding Path=Guia.identificacaoGuiaSADTSP.identificacaoFontePagadora.codigoFontePagadoraItems, ElementName=guia, Mode=OneWay}"
                            SelectedIndex="{Binding Path=Guia.identificacaoGuiaSADTSP.identificacaoFontePagadora.ItemElementName, ElementName=guia, Converter={StaticResource enumConverter}, ConverterParameter='CodigoFontePagadora', ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                        <TextBox Name="txtIdentificacaoFontePagadora" Width="180" Margin="0,6,0,0" HorizontalAlignment="Left" MaxLength="14" 
                            Text="{Binding Path=Guia.identificacaoGuiaSADTSP.identificacaoFontePagadora.ItemValue, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"/>
                    </StackPanel>
                    <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
                </Grid>
                <Grid Height="53" Margin="0,0,6,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Nº Guia Príncipal:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <TextBox Margin="0,6,323,0" MaxLength="20" Text="{Binding Path=Guia.numeroGuiaPrincipal, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"/>
                    </StackPanel>
                </Grid>
                <Grid Margin="0,0,6,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Data da Autorização:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <sdk:DatePicker HorizontalAlignment="Left" Margin="0,6,0,0" 
                            SelectedDate="{Binding Path=Guia.dadosAutorizacao._dataAutorizacao, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                    </StackPanel>
                </Grid>
                <Grid Height="53" Margin="0,0,6,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Senha:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <TextBox Margin="0,6,323,0" MaxLength="20" Text="{Binding Path=Guia.dadosAutorizacao.senhaAutorizacao, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"/>
                    </StackPanel>
                </Grid>
                <Grid Margin="0,0,6,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Data Validade da Senha:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <sdk:DatePicker HorizontalAlignment="Left" Margin="0,6,0,0" 
                            SelectedDate="{Binding Path=Guia.dadosAutorizacao._validadeSenha, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                    </StackPanel>
                </Grid>
                <Grid Margin="0,0,6,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Data de Emissão da Guia:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <sdk:DatePicker Name="dtpEmissao" HorizontalAlignment="Left" Margin="0,6,0,0" 
                            SelectedDate="{Binding Path=Guia.identificacaoGuiaSADTSP._dataEmissaoGuia, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                    </StackPanel>
                    <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
                </Grid>
            </StackPanel>
        </Grid>
        <uc:Beneficiario Value="{Binding Path=Guia.dadosBeneficiario, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
        <uc:Solicitante Value="{Binding Path=Guia.dadosSolicitante, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
        <Grid x:Name="Agrupamento" Margin="0,19,0,0" VerticalAlignment="Top">
            <Rectangle RadiusY="6" RadiusX="6" Stroke="#4D898989"/>
            <TextBlock TextWrapping="Wrap" Text="Dados da Solicitação" Margin="10,10,8,0" VerticalAlignment="Top" FontFamily="Segoe UI Semibold" FontSize="16"/>
            <StackPanel Margin="12,44,8,0">
                <Grid Height="53" Margin="0,0,6,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel x:Name="Data" Grid.ColumnSpan="2" Margin="0" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Data da Solicitação:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <sdk:DatePicker HorizontalAlignment="Left" Margin="0,6,0,0" SelectedDate="{Binding Path=Guia._dataHoraAtendimento, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                    </StackPanel>
                </Grid>
                <Grid Height="53" Margin="0,0,6,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Caráter da Solicitação:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <ComboBox Width="300" Margin="0,6,0,0" HorizontalAlignment="Left" Height="25" SelectedValue="Key" DisplayMemberPath="Value"
                            ItemsSource="{Binding Path=Guia.caraterAtendimentoItems, ElementName=guia, Mode=OneWay}"
                            SelectedIndex="{Binding Path=Guia.caraterAtendimento, ElementName=guia, Converter={StaticResource enumConverter}, ConverterParameter='EletivaEmergencia', ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
                            />
                    </StackPanel>
                    <TextBlock TextWrapping="Wrap" Text="*" FontFamily="Segoe UI" FontWeight="Bold" FontSize="21.333" Foreground="#FF307852" Height="16" VerticalAlignment="Top" Margin="0,0,3,0" d:LayoutOverrides="Width"/>
                </Grid>
                <uc:DiagnosticoAtendimento Value="{Binding Path=Guia.diagnosticoAtendimento, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                <Grid Height="53" Margin="0,0,6,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Indicação Clínica:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <TextBox Margin="0,6,323,0" MaxLength="500" Text="{Binding Path=Guia.indicacaoClinica, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                    </StackPanel>
                </Grid>
            </StackPanel>
        </Grid>

        <Grid Margin="0,19,0,0" VerticalAlignment="Top">
            <Rectangle RadiusY="6" RadiusX="6" Stroke="#4D898989"/>
            <TextBlock TextWrapping="Wrap" Text="Dados do Contratado Executante" Margin="10,10,8,0" VerticalAlignment="Top" FontFamily="Segoe UI Semibold" FontSize="16"/>
            <StackPanel Margin="12,44,8,0">
                <uc:GuiaSP_SADTPrestadorExecutante Value="{Binding Path=Guia.prestadorExecutante, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                <Grid Width="890" Margin="0,0,6,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Margin="0" Grid.ColumnSpan="2" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" FontFamily="Segoe UI" FontSize="13.333" Text="Tipo de Atendimento"/>
                        <ComboBox Width="180" Margin="0,6,0,0" HorizontalAlignment="Left" SelectedValue="Key" DisplayMemberPath="Value"
                          ItemsSource="{Binding Path=Guia.tipoAtendimentoItems,ElementName=guia,Mode=OneWay}"
                          SelectedIndex="{Binding Path=Guia.tipoAtendimento,ElementName=guia,Mode=TwoWay,Converter={StaticResource enumConverter},ConverterParameter='TipoAtendimento',ValidatesOnDataErrors=True,NotifyOnValidationError=True}"/>
                        <TextBlock Margin="0,5,0,0" TextWrapping="Wrap" FontFamily="Segoe UI" FontSize="13.333" Text="Tipo de Saida"/>
                        <ComboBox Width="180" Margin="0,6,0,0" HorizontalAlignment="Left" SelectedValue="Key" DisplayMemberPath="Value"
                          ItemsSource="{Binding Path=Guia.tipoSaidaItems,ElementName=guia,Mode=OneWay}"
                          SelectedIndex="{Binding Path=Guia.tipoSaida,ElementName=guia,Mode=TwoWay,Converter={StaticResource enumConverter},ConverterParameter='TipoSaidaGuiaSADT',ValidatesOnDataErrors=True,NotifyOnValidationError=True}"/>
                    </StackPanel>
                </Grid>
            </StackPanel>
        </Grid>
        
        <uc:ListaProcedimentosRealizados Value="{Binding Path=Guia.procedimentosRealizados, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
                                         Width="906" NumeroMinimo="1" />
        <uc:OPMUtilizada Value="{Binding Path=Guia.OPMUtilizada, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
        <uc:OutrasDespesas Value="{Binding Path=Guia.outrasDespesas, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
        <uc:ValorTotalServicos Value="{Binding Path=Guia.valorTotal, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
        <Grid Margin="0,19,0,0" VerticalAlignment="Top">
            <Rectangle RadiusY="6" RadiusX="6" Stroke="#4D898989"/>
            <StackPanel Margin="12,14,8,0">
                <Grid Height="53" Margin="0,0,6,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.024*"/>
                        <ColumnDefinition Width="0.976*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.ColumnSpan="2" Margin="0" Grid.Row="2" Grid.Column="2">
                        <TextBlock TextWrapping="Wrap" Text="Observação:" FontFamily="Segoe UI" FontSize="13.333"/>
                        <TextBox Margin="0,6,323,0" MaxLength="240" Text="{Binding Path=Guia.observacao, ElementName=guia, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}" />
                    </StackPanel>
                </Grid>
            </StackPanel>
        </Grid>
    </StackPanel>
</UserControl>
